package com.zc.controller.jhl;

import com.zc.controller.zc.ZcServcie;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * Author:PaoFaoJu
 * Date:2021-06-2021/6/23 10:41
 * Description:<描述>
 */
@RestController
@RequestMapping("/jhl")
public class jhlcontroller {
    @Autowired
    JhlService jhlService;

    @RequestMapping("jhlquery")
    @ResponseBody
    public List<Student> jhlquery(String username){
        System.out.println(username);
        List<Student> students=jhlService.jhlquery();
        return students;
    }

    @RequestMapping("jhladd")
    @ResponseBody
    public String jhladd(Student student){
        jhlService.jhladd(student);
        return "1";
    }

    @RequestMapping("jhlupdate")
    @ResponseBody
    public String jhlupdate(Student student){
        jhlService.jhlupdate(student);
        return "1";
    }

    @RequestMapping("jhldelete/{id}")
    @ResponseBody
    public String jhldelete(@PathVariable(value = "id") Integer id){
        jhlService.jhldelete(id);
        return "1";
    }


}
